/**
 * 用到命名空间
 * @type {{}}
 */
const A = {
    g: function (id) {
        return document.getElementById(id)
    },
    css: function (id, key, value) {
        document.getElementById(id).style[key] = value
    },
    attr: function (id, key, value) {
        document.getElementById(id)[key] = value
    },
    html: function (id, html) {
        document.getElementById(id).innerHTML = html
    },
    on:function (id, type, fn){
        document.getElementById(id)['on'+type] = fn
    }
}


// 调用
A.css('box','background','pink')
A.attr('box', 'data-link','https://www.baidu.com')
A.on('box','click',()=>{console.log('hahaha')})
